//package com.budwk.app.waterquality.controllers.admin;
//
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import com.budwk.app.waterquality.models.WaterReportForm;
//import com.budwk.app.waterquality.services.WaterReportFormService;
//import com.budwk.app.waterquality.vo.WaterReportFormQueryVo;
//import com.budwk.starter.common.openapi.annotation.*;
//import com.budwk.starter.common.page.PageUtil;
//import com.budwk.starter.common.result.Result;
//import com.budwk.starter.common.result.ResultCode;
//import com.budwk.starter.log.annotation.SLog;
//import lombok.extern.slf4j.Slf4j;
//import org.nutz.dao.Cnd;
//import org.nutz.ioc.loader.annotation.Inject;
//import org.nutz.ioc.loader.annotation.IocBean;
//import org.nutz.lang.Strings;
//import org.nutz.mvc.annotation.At;
//import org.nutz.mvc.annotation.Ok;
//import org.nutz.mvc.annotation.POST;
//import org.nutz.mvc.annotation.Param;
//
//import javax.servlet.http.HttpServletRequest;
//
//@IocBean
//@At("/waterquality/admin/water/report/form")
//@ApiDefinition(tag = "报表数据info")
//@SLog(tag = "报表数据info")
//@Slf4j
//public class WaterReportFormController {
//    @Inject
//    private WaterReportFormService waterReportFormService;
//
//    @At
//    @Ok("json")
//    @POST
//    @ApiOperation(name = "分页查询报表数据info")
//    public Result<?> listByPage(@Param("..") WaterReportFormQueryVo reqVo) {
//        return Result.data(waterReportFormService.listByPage(reqVo));
//    }
//
//    @At
//    @Ok("json")
//    @POST
//    @SLog(value = "新增报表数据info")
//    @ApiOperation(name = "新增报表数据info")
//    @ApiFormParams(
//        implementation = WaterReportForm.class
//    )
//    @ApiResponses
//    @SaCheckPermission("waterquality.water.report.form.update")
//    public Result<?> create(@Param("..") WaterReportForm wkWaterReportForm, HttpServletRequest req) {
//        waterReportFormService.insert(wkWaterReportForm);
//        return Result.success();
//    }
//
//    @At
//    @Ok("json")
//    @POST
//    @SLog(value = "修改报表数据info")
//    @ApiOperation(name = "修改报表数据info")
//    @ApiFormParams(
//        implementation = WaterReportForm.class
//    )
//    @ApiResponses
//    @SaCheckPermission("waterquality.water.report.form.update")
//    public Result<?> update(@Param("..") WaterReportForm wkWaterReportForm, HttpServletRequest req) {
//        waterReportFormService.updateIgnoreNull(wkWaterReportForm);
//        return Result.success();
//    }
//
//    @At("/get")
//    @Ok("json")
//    @POST
//    @SLog(value = "获取报表数据info")
//    @ApiOperation(name = "获取报表数据info")
//    @ApiFormParams(
//        {
//            @ApiFormParam(name = "id", description = "唯一标识",required = true, check = true)
//        }
//    )
//    @SaCheckPermission("waterquality.water.report.form")
//    public Result<?> getData(@Param("id")String id, HttpServletRequest req) {
//        WaterReportForm wkWaterReportForm = waterReportFormService.fetch(id);
//        if (wkWaterReportForm == null) {
//            return Result.error(ResultCode.NULL_DATA_ERROR);
//        }
//        return Result.data(wkWaterReportForm);
//    }
//
//    @At("/delete")
//    @Ok("json")
//    @POST
//    @SLog(value = "删除报表数据info")
//    @ApiOperation(name = "删除报表数据info")
//    @ApiFormParams(
//        {
//            @ApiFormParam(name = "id", description = "唯一标识",required = true, check = true)
//        }
//    )
//    @SaCheckPermission("waterquality.water.report.form.update")
//    public Result<?> delete(@Param("id")String id, HttpServletRequest req) {
//        WaterReportForm wkWaterReportForm = waterReportFormService.fetch(id);
//        if (wkWaterReportForm == null) {
//            return Result.error(ResultCode.NULL_DATA_ERROR);
//        }
//        waterReportFormService.delete(id);
//        req.setAttribute("_slog_msg", wkWaterReportForm.getId());
//        return Result.success();
//    }
//}
